﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="1001.aspx.cs" Inherits="_10_1001" %>

<%@ Register Assembly="MattBerseth.WebControls" Namespace="MattBerseth.WebControls" TagPrefix="cc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
    function update(msg) {
        __doPostBack('<%=UpdatePanel1.ClientID%>', '');
        tb_remove();
        alert(msg);
    }

    function pageLoad(sender, args) {
        if (args.get_isPartialLoad()) {
            //  reapply the thick box stuff
            tb_init('a.thickbox, input.thickbox,');
        }
    }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
        SelectCountMethod="Get_doctor_AllData_Count" SelectMethod="Get_doctor_AllData"
        TypeName="CCH.DAO.doctorprofileDAO" EnablePaging="True"></asp:ObjectDataSource>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="DivButton">
                <input type="button" value="新增醫師資料" class="thickbox new" alt="1001-1.aspx?mode=new&TB_iframe=true&modal=true&width=800&height=520">
            </div>
            <div class="datatable">
                <cc1:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False"
                    AllowPaging="True" EmptyDataText="目前無資料" DataKeyNames="doc_no" 
                    onrowcommand="GridView1_RowCommand">
                    <Columns>
                        <asp:BoundField DataField="doc_name" HeaderText="醫師姓名" SortExpression="doc_name" />
                        <asp:BoundField DataField="doc_title" HeaderText="職稱" SortExpression="doc_title" />
                        <asp:TemplateField HeaderText="現任">
                            <ItemTemplate>
                                <asp:Label ID="Label4" runat="server" Text='<%# Eval("doc_job") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="排序">
                            <ItemTemplate>
                                <asp:Label ID="Label3" runat="server" Text='<%# Eval("doc_order") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="7%" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="修建者">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Get_peopleName(Eval("createuid")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="7%" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="修建時間">
                            <ItemTemplate>
                                <asp:Label ID="Label2" runat="server" Text='<%# Get_DateTime(Eval("createtime")) %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="10%" HorizontalAlign="Center" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="修改" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <a class="thickbox imageButton edit" title='<%# Eval("doc_name", "修改{0}") %>' href='<%# Eval("doc_no", "1001-1.aspx?mode=edit&ID={0}&modal=true&TB_iframe=true&width=800&height=520") %>'>
                                <span>修改</span></a>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="刪除">
                            <ItemTemplate>
                                <asp:Button ID="button_disable" runat="server" CommandName="disable" CssClass="delete" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick=" return confirm('確定要刪除?')" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" Width="7%" />
                        </asp:TemplateField>
                    </Columns>
                </cc1:GridView>
            </div>
            <div class="pager">
                <asp:DataPager ID="DataPager1" runat="server" PagedControlID="GridView1" PageSize="25">
                    <Fields>

                        <CCH:GooglePagerField />
                    </Fields>
                </asp:DataPager>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>

